﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Filters;

namespace FutureSerWeb.Func
{
    public static class AppFilters
    {
        public static class Authorization
        {
            public class GlobalFilter : IAuthorizationFilter
            {
                public void OnAuthorization(AuthorizationFilterContext context)
                {
                    //context.HttpContext.Request.Body.Position = 0;
                    //using var reqReader = new StreamReader(context.HttpContext.Request.Body);
                    //var reqContent = reqReader.ReadToEndAsync().Result;
                    //context.HttpContext.Request.Body.Position = 0;
                }
            }
        }
        public static class Action
        {
            public class GlobalFilter : ActionFilterAttribute
            {
                public override void OnActionExecuting(ActionExecutingContext context)
                {
                }
                public override void OnActionExecuted(ActionExecutedContext context)
                {
                }
            }
            public class ControllerFilter : ActionFilterAttribute
            {
                public override void OnActionExecuting(ActionExecutingContext context)
                {
                }
                public override void OnActionExecuted(ActionExecutedContext context)
                {
                }
            }
            public class OtherControllerFilter : ActionFilterAttribute
            {
                public override void OnActionExecuting(ActionExecutingContext context)
                {
                }
                public override void OnActionExecuted(ActionExecutedContext context)
                {
                }
            }
            public class ActionFilter : ActionFilterAttribute
            {
                public override void OnActionExecuting(ActionExecutingContext context)
                {
                }
                public override void OnActionExecuted(ActionExecutedContext context)
                {
                }
            }
            public class OtherActionFilter : ActionFilterAttribute
            {
                public override void OnActionExecuting(ActionExecutingContext context)
                {
                }
                public override void OnActionExecuted(ActionExecutedContext context)
                {
                }
            }

        }
        public static class Exception
        {
            public class GlobalFilter : ExceptionFilterAttribute
            {
                public override void OnException(ExceptionContext context)
                {
                }
            }
        }
    }
}
